# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import datetimeOperationConstants

class DictOperationSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(DictOperationSubDirectiveTree, self).__init__(parent)
        self.createDictOperationTreeNode()

    def createDictOperationTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "datetimeOperation"
        self.setText(0,"日期时间操作")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, datetimeOperationConstants.DatetimeOperationConstants.gettingCurrentDatetimeDictDirective, "获取当前日期时间")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, datetimeOperationConstants.DatetimeOperationConstants.increasingOrDecreasingTimeDirective, "增加/减少时间")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, datetimeOperationConstants.DatetimeOperationConstants.gettingTimeIntervalDirective, "获取时间间隔")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, datetimeOperationConstants.DatetimeOperationConstants.convertingToDatetimeDirective, "转换到日期时间")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, datetimeOperationConstants.DatetimeOperationConstants.convertingDatetimeToTextDirective, "日期时间转换成文本")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, datetimeOperationConstants.DatetimeOperationConstants.gettingDetailedTimeInfoDirective, "获取时间详细信息")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, datetimeOperationConstants.DatetimeOperationConstants.convertingDatetimeToTimestampDirective, "日期时间转换为时间戳")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, datetimeOperationConstants.DatetimeOperationConstants.convertingTimestampToDatetimeDirective, "时间戳转换为日期时间")